/*                                  ATELIER                                   */

/* %%LICENSE_TAG%%                                                            */
package edu.gmu.view.canvas;


/**
 * AbstractMouseMode provides common implementations for getter/setter
 * methods for MouseModes.
 */
public abstract class AbstractMouseMode implements MouseMode
{   
    /**
     * Canvas to get Layers from to delegate MouseEvent's to
     */
    protected Canvas canvas = null;

    /**
     * Active state of the MouseMode
     */
    protected volatile boolean active = false;
    
    /**
     * Creates a new AbstractMouseMode with default values.
     */
    public AbstractMouseMode( )
    {
        
    }

    /**
     * Creates a new AbstractMouseMode with specified values.
     * 
     * @param canvas
     */
    public AbstractMouseMode( Canvas canvas )
    {
        this.canvas = canvas;
    }
    
    /**
     * Sets the Canvas for the MouseMode.
     * 
     * @param canvas
     */
    public void setCanvas( Canvas canvas )
    {
        this.canvas = canvas;
    }

    /**
     * Gets the Canvas for the MouseMode.
     * 
     * @return Canvas canvas
     */
    public Canvas getCanvas( )
    {
        return this.canvas;
    }
    
    /**
     * Sets the active state of the MouseMode.
     *
     * @param active
     */
    public void setActive( boolean active )
    {
        this.active = active;
    }
    
    /**
     * Gets the active state of the MouseMode.
     *
     * @return boolean true if MouseMode is active
     */
    public boolean getActive( )
    {
        return this.isActive();
    }
    
    /**
     * Gets the active state of the MouseMode.
     *
     * @return boolean true if MouseMode is active
     */
    public boolean isActive( )
    {
        return this.active;
    }
    
    
}

/*                                  ATELIER                                   */